package com.smart.yun.client;

import com.smart.common.utils.PageUtils;
import com.smart.common.utils.R;
import com.smart.domain.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cardc-plat-service")
public interface PlatInfoClient {
	//TODO 以下是平台表的跳转
	@RequestMapping(value = "/plat/platInfo/list",method = RequestMethod.GET)
	PageUtils list(@RequestParam Map<String, Object> params);
	@RequestMapping(value = "/plat/platInfo/batchRemove",method = RequestMethod.GET)
	R batchRemove(@RequestParam Integer[] platIds);

	@RequestMapping(value = "/plat/platInfo/save",method = RequestMethod.GET)
	R save(@RequestBody PlatInfoDO platInfo);

	@RequestMapping(value = "/plat/platInfo/changeStatus",method = RequestMethod.GET)
	R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status);

	@RequestMapping(value = "/plat/platInfo/remove",method = RequestMethod.GET)
	R remove(@RequestParam("platId") Integer platId);

	@RequestMapping(value = "/plat/platInfo/listPlatDict",method = RequestMethod.GET)
	List<PlatInfoDO> listPlatDict();

	//获取列表
	@RequestMapping(value = "/plat/merchantInfo/list",method = RequestMethod.GET)
	PageUtils merchantInfoList(@RequestParam Map<String, Object> map);
	//保存
	@RequestMapping(value = "/plat/merchantInfo/save",method = RequestMethod.GET)
	R saveMerchantInfo(MerchantInfoDO merchantInfo);
	//下拉字典
	@RequestMapping(value = "/plat/merchantInfo/listMerchantDict",method = RequestMethod.GET)
	List<MerchantInfoDO> listMerchantDict(@RequestParam Integer platId);

	//修改
	@RequestMapping(value = "/plat/merchantInfo/update",method = RequestMethod.GET)
	R updateMerchantInfo(@RequestBody MerchantInfoDO merchantInfo);

	@RequestMapping(value = "/plat/merchantInfo/remove",method = RequestMethod.GET)
	R removeMerchant(@RequestParam Integer merchantId);

	@RequestMapping(value = "/plat/merchantInfo/batchRemove",method = RequestMethod.GET)
	R batchRemoveMerchant(@RequestParam Integer[] merchantIds);

	@RequestMapping(value = "/plat/merchantInfo/edit",method = RequestMethod.GET)
	MerchantInfoDO getMerchant(@RequestParam Integer merchantId);

	@RequestMapping(value = "/plat/merchantInfo/changeStatus",method = RequestMethod.GET)
	R changeStatusMerchant(@RequestParam Long id, @RequestParam Integer status);

	//返回商户列表
	@RequestMapping(value = "/plat/shopInfo/listShops",method = RequestMethod.GET)
	PageUtils listShops(@RequestParam Map<String, Object> map);

	//返回门店名称 作为下拉列表
	@RequestMapping(value = "/plat/shopInfo/listShopDict",method = RequestMethod.GET)
	List<ShopInfoDO> listShopDict(@RequestParam Integer merchantId);

	@RequestMapping(value = "/plat/shopInfo/edit",method = RequestMethod.GET)
	String getShop(@RequestParam Integer shopId);



	@RequestMapping(value = "/plat/shopInfo/save",method = RequestMethod.POST)
	R saveShopInfo(@RequestParam Map<String, Object> stringObjectMap, @RequestParam String fileIds, @RequestParam String userName, @RequestParam String businessHoursS, @RequestParam String businessHoursE);

	@RequestMapping(value = "/plat/shopInfo/update",method = RequestMethod.GET)
	R updateShopInfo(@RequestParam Map<String, Object> stringObjectMap, @RequestParam String fileIds, @RequestParam String userName, @RequestParam String businessHoursS, @RequestParam String businessHoursE);

	@RequestMapping(value = "/plat/shopInfo/remove",method = RequestMethod.GET)
	R removeShopInfo(@RequestParam Integer shopId);

	@RequestMapping(value = "/plat/shopInfo/batchRemove",method = RequestMethod.GET)
	R batchRemoveShopInfo(@RequestParam Integer[] shopIds);
	@RequestMapping(value = "/plat/shopInfo/changeStatus",method = RequestMethod.GET)
	R changeStatusShopInfo(@RequestParam Integer id, @RequestParam int status);

	@RequestMapping(value = "/plat/shopInfo/editStation",method = RequestMethod.GET)
	ShopInfoDO getStation(@RequestParam Integer shopId);

	@RequestMapping(value = "/plat/stationInfo/get",method = RequestMethod.POST)
	StationInfoDO getStationById(@RequestParam Integer stationId);


	/*
   数据字典相关服务  开始
    */
	@RequestMapping(value = "/basedata/dict/type",method = RequestMethod.GET)
	R listType();

	@RequestMapping(value = "/basedata/dict/list",method = RequestMethod.GET)
	PageUtils listDic(@RequestParam Map<String, Object> map);

	@RequestMapping(value = "/basedata/dict/save",method = RequestMethod.POST)
	R save(@RequestBody DictDO dict);

	@RequestMapping(value = "/basedata/dict/update",method = RequestMethod.POST)
	R update(@RequestBody DictDO dict);

	@RequestMapping(value = "/basedata/dict/checkDuplicate",method = RequestMethod.GET)
	R checkDuplicate(@RequestBody DictDO dict, @RequestParam("flag") String flag);

	@RequestMapping(value = "/basedata/dict/get",method = RequestMethod.GET)
	R get(@RequestParam Long id);

	@RequestMapping(value = "/basedata/dict/remove",method = RequestMethod.POST)
	R remove(@RequestParam Long id);

	@RequestMapping(value = "/basedata/dict/batchRemove",method = RequestMethod.POST)
	R batchRemove(@RequestParam Long[] ids);

	@RequestMapping(value = "/basedata/dict/listByType",method = RequestMethod.POST)
	R listByType(@RequestParam Map<String, Object> map);

	@RequestMapping(value = "/basedata/dict/listdictbykeys",method = RequestMethod.GET)
	R listDicts(@RequestParam String[] keys);

	@RequestMapping(value = "/basedata/dict/baseAreaList",method = RequestMethod.GET)
	R getDicByType(@RequestParam Map<String, Object> map);

	/*
      区域信息  开始
    */
	@RequestMapping(value = "/basedata/baseArea/list",method = RequestMethod.GET)
	PageUtils baseAreaList(@RequestParam Map<String, Object> map);

	@RequestMapping(value = "/basedata/baseArea/get",method = RequestMethod.GET)
	R getAreaById(@RequestParam Integer id);

	@RequestMapping(value = "/basedata/baseArea/save",method = RequestMethod.POST)
	R saveArea(@RequestBody BaseAreaDO baseArea);

	@RequestMapping(value = "/basedata/baseArea/update",method = RequestMethod.POST)
	R updateArea(@RequestBody BaseAreaDO baseArea);

	@RequestMapping(value = "/basedata/baseArea/remove",method = RequestMethod.POST)
	R removeArea(@RequestParam Integer id);

	@RequestMapping(value = "/basedata/baseArea/batchRemove",method = RequestMethod.POST)
	R batchRemoveArea(@RequestParam Integer[] ids);

	@RequestMapping(value = "/basedata/baseArea/listProvince",method = RequestMethod.GET)
	R listProvince(@RequestParam Map<String, Object> map);

	@RequestMapping(value = "/basedata/baseArea/baseAreaList",method = RequestMethod.GET)
	R getAreaByType(@RequestParam Map<String, Object> map);

	@RequestMapping(value = "/basedata/baseArea/tree",method = RequestMethod.GET)
	R getTree(@RequestParam String areaType);

	/*
     序列号生成器  开始
   */
	@RequestMapping(value = "/basedata/geneseq/list",method = RequestMethod.GET)
	PageUtils listGen(@RequestParam Map<String, Object> params);

	@RequestMapping(value = "/basedata/geneseq/save",method = RequestMethod.POST)
	R saveGen(@RequestBody GeneseqDO geneseqDO);

	@RequestMapping(value = "/basedata/geneseq/update",method = RequestMethod.POST)
	R updateGen(@RequestBody GeneseqDO geneseqDO);

	@RequestMapping(value = "/basedata/geneseq/get",method = RequestMethod.GET)
	R getGen(@RequestParam Long id);

	@RequestMapping(value = "/basedata/geneseq/remove",method = RequestMethod.POST)
	R removeGen(@RequestParam Long id);

	@RequestMapping(value = "/basedata/geneseq/batchRemove",method = RequestMethod.POST)
	R batchRemoveGen(@RequestParam Long[] ids);

	@RequestMapping(value = "/basedata/geneseq/getValue",method = RequestMethod.GET)
	String getValue(@RequestParam String name);


	/**
	 * 查询当前开班记录
	 * @param stationId 油站id
	 * @return
	 */
	@RequestMapping(value = "/other/stationClasses/getNowStationClasses",method = RequestMethod.GET)
	StationClassesDO getNowStationClasses(@RequestParam Integer stationId);

	/**
	 * 开结班管理
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/other/stationClasses/closeAndOpenClasses",method = RequestMethod.POST)
	R closeAndOpenClasses(@RequestParam Map<String, Object> map);

	@RequestMapping(value = "/other/stationClasses/getStationClasses",method = RequestMethod.GET)
	List<StationClassesDO> getStationClasses(@RequestParam Map<String, Object> mapGet);

	@RequestMapping(value = "/other/stationClasses/getStationClassesByDate",method = RequestMethod.GET)
	List<StationClassesDO> getStationClassesByDate(@RequestParam Map<String, Object> mapGetByDate);

	@RequestMapping(value = "/other/o2o/api",method = RequestMethod.GET)
	R o2oMessage(@RequestParam String toJSONString);


	/*
    用户服务  开始
  */
	@RequestMapping(value = "/user/userInfo/list",method = RequestMethod.GET)
	PageUtils pageList(@RequestParam Map<String, Object> params);

	@RequestMapping(value = "/user/userInfo/get",method = RequestMethod.GET)
	R getUserById(@RequestParam Long memId);

	@RequestMapping(value = "/user/userInfo/selectUserByOpenId",method = RequestMethod.GET)
	UserInfoDO selectUserByOpenId(@RequestParam String openId);

	@RequestMapping(value = "/user/userInfo/save",method = RequestMethod.POST)
	R save(@RequestBody UserInfoDO userInfoDO);

	@RequestMapping(value = "/user/userInfo/update",method = RequestMethod.POST)
	R update(@RequestBody UserInfoDO userInfoDO);

	@RequestMapping(value = "/user/userInfo/getUserInfoByOpenId",method = RequestMethod.GET)
	UserInfoDO getUserInfoByOpenId(@RequestParam String openId);

	@RequestMapping(value = "/user/userInfo/getOilUserByUserPhone",method = RequestMethod.GET)
	UserInfoDO getOilUserByUserPhone(@RequestParam String oilUserPhone);

	@RequestMapping(value = "/user/points/savePoints",method = RequestMethod.POST)
	R savePoints(@RequestBody Map<String, Object> map);

	@RequestMapping(value = "/user/pointsDetails/getPointsDetail",method = RequestMethod.GET)
	int getPointsDetail(@RequestParam Map<String, Object> map);

	@RequestMapping(value = "/user/points/getPointsByUserId",method = RequestMethod.GET)
	R getPointsByUserId(@RequestParam Map<String, Object> map);

	/**
	 * 绑定手机号
	 * @param memberMobile
	 * @param smsCodeAuthCode
	 * @param openId
	 * @return
	 */
	@RequestMapping(value = "/regist/bind/mobile",method = RequestMethod.POST)
    ApiResultEntity bindMobile(@RequestParam("memberMobile") String memberMobile,
                               @RequestParam("smsCodeAuthCode") String smsCodeAuthCode,
                               @RequestParam("openId") String openId);

	/**
	 * 发送手机验证码
	 * @param memberMobile
	 * @param sendType
	 * @return
	 */
	@RequestMapping(value = "/regist/sendSmsCode",method = RequestMethod.POST)
	ApiResultEntity sendSmsCode(@RequestParam("memberMobile") String memberMobile,
                                @RequestParam(value = "sendType", required = false) Integer sendType);

	/**
	 * 绑定车牌号
	 * @param userId 用户id
	 * @param userPlate 用户车牌号
	 * @return
	 */
	@RequestMapping(value = "/bind/plate",method = RequestMethod.POST)
	R bindPlat(@RequestParam("userId") Integer userId, @RequestParam("userPlate") String userPlate);

	/**
	 * 绑定油卡号
	 * @param userId 用户id
	 * @param userOilNum 油卡号
	 * @return
	 */
	@RequestMapping(value = "/bind/oilNum",method = RequestMethod.POST)
	R bindOilNum(@RequestParam("userId") Integer userId, @RequestParam("userOilNum") String userOilNum);

	/**
	 * 查询指定日期的班报开班和结班时间
	 * @param map days查询几日  date指定日期  oilUserDeptId油站ID
	 * @return
	 */
	@RequestMapping(value = "/other/stationClasses/getClassesDates",method = RequestMethod.GET)
    R getClassDates(@RequestParam Map<String, Object> map);

	/**
	 * 日报
	 * @param map oilStationId 油站id  queryDate 查询日期
	 * @return
	 */
	@RequestMapping(value = "/other/stationClasses/findStationDailyEcpList",method = RequestMethod.GET)
	R findStationDailyEcpList(@RequestParam Map<String, Object> map);

	/**
	 * 班报
	 * @param map createTime开班时间、updateTime结班时间、stationId油站id
	 * @return
	 */
	@RequestMapping(value = "/other/stationClasses/findStationClassesEcpList",method = RequestMethod.GET)
    R findStationClassesEcpList(@RequestParam Map<String, Object> map);

	/**
	 * 推送微信模板消息
	 * @param wxMsgParam
	 * @return
	 */
	@RequestMapping(value="/system/wxcmsMsgTemplet/sendTplMsg",method = RequestMethod.POST)
	R sendTplMsg(@RequestBody Map<String, String> wxMsgParam);
}